﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace ImportDB
{
    
    public class XLSXFile : PlainDataFileBase, IPlainDataFile
    {
        private string fileName;
        public XLSXFile(string fileName)
        {
            this.fileName = fileName;
        }


        public System.Data.DataTable GetDataTable()
        {
            string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + this.fileName + "; Extended Properties=\"Excel 12.0 Xml;HDR=YES\"";
            string sql = "select * from [sheet1$]";
            DataTable dt = GetTable(connectionString, sql);
            return dt;
        }

    }
}
